package work20241125;

import com.sun.deploy.net.offline.WIExplorerOfflineHandler;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/25
 */
public class Demo2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int[] arr = new int[10];
        for (int i = 0; i < 10; i++) {
            System.out.println("请输入第" + (i + 1) + "个数:");
            int num = sc.nextInt();
            if (num == 886) {
                System.out.println("程序终止!!");
                break;
            } else {
                arr[i] = num;
                sum += arr[i];

            }
        }
        System.out.println(sum);
    }
}
